'''
Created on 2011-12-15

@author: alex.ren
'''
#try adding #pythoncom to the "Forced Builtins" tab of your 
#Python interpreter configuration to see if it
#helps (restart eclipse after you've done that,
#http://sourceforge.net/projects/pyhook/

import screener
import time
import interface

orbit_file_name = 'c:/swpy.txt'
start = False
f = file(orbit_file_name, 'a')

def record():
    screener.show()
    time.sleep(5)
    while True:
        time.sleep(1)
        x = interface.getX()
        y = interface.getY()
        pos = str(x) + ',' + str(y)
        print pos
        f.write(pos)
        f.write('\n')
        f.flush()

if __name__ == '__main__':
    record()
    
